package com.tonann.app.domain;

import com.tonann.common.annotation.Excel;
import com.tonann.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import sun.management.Sensor;

/**
 * 故障记录对象 app_fault
 *
 * @author tonann
 * @date 2022-10-15
 */
@Data
public class AppFault extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long faultId;

    /** 故障规则 */
    @Excel(name = "故障规则")
    private Long faultRuleId;

    /** 传感器 */
    @Excel(name = "传感器")
    private Long sensorId;

    /** 故障值 */
    @Excel(name = "故障值")
    private String faultValue;

    /** 故障编码 */
    @Excel(name = "故障编码")
    private String faultCode;

    /**
     * 故障名称
     */
    @Excel(name = "故障名称")
    private String faultName;

    /**
     * 设备类型
     */
    @Excel(name = "设备类型")
    private String deviceType;

    /**
     * 设备Id
     */
    @Excel(name = "设备Id")
    private Long deviceId;

    private AppFaultHandle faultHandle;

    private String deviceName;

    private AppSensor sensor;

    private AppDevice device;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("faultId", getFaultId())
                .append("faultRuleId", getFaultRuleId())
                .append("sensorId", getSensorId())
                .append("faultValue", getFaultValue())
                .append("faultCode", getFaultCode())
                .append("faultName", getFaultName())
            .append("deviceType", getDeviceType())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
